package com.boot.stream;

import com.alibaba.fastjson.JSONObject;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.streams.processor.TimestampExtractor;

public class StatictisTimestampExtractor implements TimestampExtractor {
    @Override
    public long extract(ConsumerRecord<Object, Object> record, long partitionTime) {
        String value = record.value().toString();
        JSONObject json = JSONObject.parseObject(value);
        return json.getLongValue("createTime");
    }
}
